<template>
    <svg :class="svgClass" aria-hidden="true">
      <use :xlink:href="iconName" :fill="color" />
    </svg>
  </template>
  
  <script>
  import { computed, defineComponent } from 'vue';
  export default defineComponent({
    props: {
      iconClass: {
        type: String,
        required: true,
      },
      className: {
        type: String,
        default: '',
      },
      color: {
        type: String,
        default: '',
      },
    },
    setup(props) {
      return {
        iconName: computed(() => `#${props.iconClass}`),
        svgClass: computed(() => {
          if (props.className) {
            return `svg-icon ${props.className}`;
          }
          return 'svg-icon';
        }),
      };
    },
  });
  </script>
  
  <style scoped>
  .svg-icon {
    width: 32px;
    height: 32px;
    position: relative;
    fill: #000;
    vertical-align: -2px;
  }
  </style>
  